//
//  CZNetWorkManager.m
//  JiaZhaengHuiYuan
//
//  Created by YYKJ1 on 2018/11/23.
//  Copyright © 2018年 YYKJ1. All rights reserved.
//

#import "CZNetWorkManager.h"

@implementation CZNetWorkManager
+ (instancetype)sharedInstance
{
    static CZNetWorkManager* manager = nil;
    
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        manager = [[CZNetWorkManager alloc]init];
    });
    return manager;
}
-(instancetype)init {
    self = [super init];
    if (self) {
        /**
         *  配置manager信息
         */
        //发送
        self.requestSerializer = [AFHTTPRequestSerializer serializer];
        self.requestSerializer.timeoutInterval = 10;
        
        //返回
        self.responseSerializer = [AFHTTPResponseSerializer serializer];
//
        
//
//       //返回数据为空的问题
//        ((AFJSONResponseSerializer *) self.responseSerializer).removesKeysWithNullValues = YES;
//
        
        

        //self.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/javascript", @"text/json", @"text/html", nil];
        
        //self.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/plain", @"multipart/form-data", @"application/json", @"text/html", @"image/jpeg", @"image/png", @"application/octet-stream", @"text/json", nil];
        
    
        
//        self.requestSerializer.cachePolicy = NSURLRequestReloadIgnoringLocalCacheData;
//        [self.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"];
//
//        [self.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
        //self.securityPolicy.allowInvalidCertificates = YES;
    }
    return self;
}
@end
